package com.highcom.dao;


import com.highcom.domain.Student;
import com.highcom.mapper.StudentMapper;
import com.highcom.mapper.impl.StudentMapperImpl;
import org.junit.Test;

import java.util.List;



public class StudentTest {

    @Test
    public void testSelectById() {
        //System.out.println("test...");
        StudentMapper mapper = new StudentMapperImpl();
        Student student = mapper.selectById(1);
        System.out.println("student = " + student);

    }

    @Test
    public void testSelectAll() {
        //System.out.println("test...");
        StudentMapper mapper = new StudentMapperImpl();
        List<Student> students = mapper.selectAll();
        System.out.println("students = " + students);


    }

    @Test
    public void testInsert() {
        //System.out.println("test...");
        StudentMapper mapper = new StudentMapperImpl();
        Student student = new Student();
        student.setName("tom");
        student.setAge(15);
        Integer i = mapper.insert(student);
        System.out.println("i = " + i);

    }
    @Test
    public void testUpdate() {
        //System.out.println("test...");
        StudentMapper mapper = new StudentMapperImpl();
        Student student = new Student();
        student.setId(1);
        student.setName("lilei01");
        student.setAge(20);
        Integer i = mapper.update(student);
        System.out.println("i = " + i);

    }
    @Test
    public void testDelete() {
        //System.out.println("test...");
        StudentMapper mapper = new StudentMapperImpl();

        Integer i = mapper.delete(4);
        System.out.println("i = " + i);

    }

}